Sketch in version two '-^2' format for discussion.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 10 Jan 2005 14:49:46 +0000 (14:49 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 10 Jan 2005 14:49:46 +0000 (14:49 +0000)
gpsbabel/vecs.c

index 4240f8c5f80453391273db3846f174413dc44f20..c98ac0ff212d9d9b6e01c9e2f1019458296043ae 100644 (file)
@@ -327,7 +327,6 @@ vecs_t vec_list[] = {
                 "vcf",
                 "Vcard Output (for iPod)",
                 "vcf",
-                NULL
         },
        {
                NULL,
@@ -587,6 +586,18 @@ disp_v1(ff_type t)
        }
        printf("%s\t", tstring);
 }
+
+static void
+disp_v2(ff_vecs_t *v)
+{
+       int i;
+       for (i = 0; i < 3; i++) {
+               putchar(v->cap[i] & ff_cap_read  ? 'r' : '-');
+               putchar(v->cap[i] & ff_cap_write  ? 'w' : '-');
+       }
+       putchar('\t');
+}
+
 /*
  *  Display the available formats in a format that's easy to machine
  *  parse.   Typically invoked by programs like graphical wrappers to
@@ -601,6 +612,7 @@ disp_formats(int version)
        switch(version) {
        case 0:
        case 1:
+       case 2:
                for (vec = vec_list; vec->vec; vec++) {
                        /* Version 1 displays type at front of all types.
                         * Version 0 skips internal types.
@@ -611,6 +623,9 @@ disp_formats(int version)
                                if (vec->vec->type == ff_type_internal)
                                        continue;
                        }
+                       if (version >= 2) {
+                               disp_v2(vec->vec);
+                       }
                        printf("%s\t%s\t%s\n", vec->name, 
                                vec->extension? vec->extension : "", 
                                vec->desc);